package com.flesler.stickjoy.controller
{
	public final class ControllerButton extends BaseControllerComponent implements ControllerComponent
	{
		private var _isDown:Boolean = false;
		
		public function ControllerButton(key:String)
		{
			super(key);
		}
		
		// ControllerComponent Implementation
		
		public function get isAnalog():Boolean
		{
			return false;
		}
		
		
		public function get value():Object
		{
			return isDown;
		}
		
		//
		
		public function get isDown():Boolean
		{
			return _isDown;
		}
		
		public function set isDown(v:Boolean):void
		{
			if (v === isDown)
				return;
			
			_isDown = v;
			changed();
		}
		
		public function press():void
		{
			isDown = true;;
		}
		
		public function release():void
		{
			isDown = false;
		}
		
	}
}